/**
 * Created by Administrator on 16-2-23.
 */
/**
 * Created by Administrator on 16-2-22.
 */
/**
 * Created by cxj on 2016/2/2.
 */
define([
    "jquery",
    "IO",
    "bootbox"
], function($,IO,bootbox) {
    $(document).on("click",".publish",function(){

        var cate_name=$("#cate_name").val();
        var category_id = $("#category_id").val();
        var param={};
        //var param={category_id:category_id};


        if(cate_name==""){
            alert("请输入分类名称");
            return;
        }

        if(param&&param!='undefined'){
            param.cate_name = cate_name;
            param.category_id = category_id;
            bootbox.confirm("确定要更改该分类？",function(result){

                if(result) {
                    IO.post("act/update_fenlei",param,function(d){
                        bootbox.alert(d.msg,function(){
                            if (d.code == 0) {
                                location.href = '/pte/inform_fenlei';
                            }
                        })
                    });
                }
                //if(result) {
                //    IO.post("act/price_add",param,function(d){
                //
                //    });
                //}
            });
        }
    });


});